DEFINITION MODULE VControl;

(*
VDI Control Functions.

UK __DATE__ __TIME__
*)

(*DEF_SWITCHES*)

FROM PORTAB IMPORT ANYPOINTER,UNSIGNEDWORD,SIGNEDWORD,ANYBYTE;
FROM VDI    IMPORT MFDB,XY;

#if ST
PROCEDURE NOTVQGDOS(): BOOLEAN;
PROCEDURE VQFSMGDOS(): BOOLEAN;
PROCEDURE VQFNTGDOS(): BOOLEAN;
PROCEDURE VQSpeedoGDOS(): BOOLEAN;
#endif

(* [V]DI: [Get] [Driver] [Info] ********************************************)

TYPE InfoSelections = (DrvResvd,DrvFName,DrvNames,DrvXNames,DrvFonts,
                       DrvPatch);

PROCEDURE VGetDriverInfo(    Device    : UNSIGNEDWORD;
                             Info      : InfoSelections;
                         VAR InfoString: ARRAY OF CHAR;
                         VAR InfoWord  : UNSIGNEDWORD);

(* [V]DI: [Op]e[n] [W]or[k]station *****************************************)

CONST NDC = 0;
      RC  = 2;

      MaxWorkIn  = 103; (* GEM/3 *)
      MaxWorkOut =  57;

      Screen   = 1;
      Plotter  = 11;
      Printer  = 21;
      Metafile = 31;
      Camera   = 41;
      Tablet   = 51;
      Memory   = 61;
      Image    = 91;

      OWFile     = 0;
      OWSerial   = 1;
      QWParallel = 2;
      OWDevice   = 3;
      OWNoChange = 255;

      OWLetter1  = 0;
      OWHalf     = 5;
      OWB5       = 10;
      OWLetter2  = 20;
      OWA4       = 30;
      OWLegal    = 40;
      OWDouble   = 50;
      OWBroad    = 55;
      OWIndirect = 255;

PROCEDURE VOpnWk(VAR WorkIn : ARRAY OF UNSIGNEDWORD;
                     MaxX   : XY;
                     MaxY   : XY;
                 VAR Handle : UNSIGNEDWORD;
                 VAR WorkOut: ARRAY OF UNSIGNEDWORD;
                 VAR Buffer : MFDB);

(* [V]DI: [Cl]o[s]e [W]or[k]station ****************************************)

PROCEDURE VClsWk(VAR Handle: UNSIGNEDWORD);

(* [V]DI: [Op]e[n] [V]irtual Screen [W]or[k]station ************************)

PROCEDURE VOpnVWk(VAR WorkIn : ARRAY OF UNSIGNEDWORD;
                  VAR Handle : UNSIGNEDWORD;
                  VAR WorkOut: ARRAY OF UNSIGNEDWORD);

(* [V]DI: [Cl]o[s]e [V]irtual Screen [W]or[k]station ***********************)

PROCEDURE VClsVWk(VAR Handle: UNSIGNEDWORD);

(* [V]DI: [Op]e[n] [B]it[m]ap **********************************************)

PROCEDURE VOpnBm(VAR WorkIn : ARRAY OF UNSIGNEDWORD;
                 VAR Bitmap : MFDB;
                 VAR Handle : UNSIGNEDWORD;
                 VAR WorkOut: ARRAY OF UNSIGNEDWORD);

(* [V]DI: [Cl]o[s]e [B]it[m]ap *********************************************)

PROCEDURE VClsBm(VAR Handle: UNSIGNEDWORD);

(* [V]DI: [Cl]ea[r] [W]or[k]station ****************************************)

PROCEDURE VClrWk(Handle: UNSIGNEDWORD);

(* [V]DI: [Upd]ate [W]or[k]station *****************************************)

TYPE PrinterErrors = (NoError,PrinterNotReady,TonerEmpty,WarmUp,PaperEmpty,
                      DrumEmpty,InputJam,ThroughJam,OutputJam,CoverOpen,
                      FuserMalfunction,ImagerMalfunction,MotorMalfunction,
                      VideoMalfunction,SystemTimeout);

PROCEDURE VUpdWk(    Handle: UNSIGNEDWORD;
                 VAR Buffer: MFDB): UNSIGNEDWORD;

(* [V]DI [S]et [T]ext Attributes: [Load] [Fonts] ***************************)

PROCEDURE VSTLoadFonts(Handle: UNSIGNEDWORD;
                       Select: UNSIGNEDWORD;
                       Max   : UNSIGNEDWORD;
                       Free  : UNSIGNEDWORD): UNSIGNEDWORD;

(* [V]DI [S]et [T]ext Attributes: [Unload] [Fonts] *************************)

PROCEDURE VSTUnloadFonts(Handle: UNSIGNEDWORD;
                         Select: UNSIGNEDWORD);

(* [V]DI: [S]et [Clip]ping Rectangle ***************************************)

PROCEDURE VSClip(    Handle: UNSIGNEDWORD;
                     Clip  : BOOLEAN;
                 VAR PXY   : ARRAY OF XY);

(* [V]DI: [Set] Bezier [App]lication [Buff]er ******************************)

PROCEDURE VSetAppBuff(Handle: UNSIGNEDWORD; (* will be ignored     *)
                      Buf   : ANYPOINTER;
                      Size  : UNSIGNEDWORD); (* amount of 16 bytes *)

(* [V]DI: Switch [Bez]ier [C]apability [On]Off *****************************)

PROCEDURE VBezCOn(Handle: UNSIGNEDWORD; OnOff: BOOLEAN): UNSIGNEDWORD;

(* [V]DI: Switch [Bez]ier Functions [On] ***********************************)

PROCEDURE VBezOn(Handle: UNSIGNEDWORD): UNSIGNEDWORD;

(* [V]DI: Switch [Bez]ier Functions [Off] **********************************)

PROCEDURE VBezOff(Handle: UNSIGNEDWORD);

(* [V]DI: Set [Bez]ier [Qual]ity *******************************************)

PROCEDURE VBezQual(Handle: UNSIGNEDWORD;
                   PrCnt : UNSIGNEDWORD): UNSIGNEDWORD;

(* [V]DI: [Q]uery [Bez]ier Capability **************************************)

PROCEDURE VQBez(Handle: UNSIGNEDWORD):BOOLEAN;

(* [V]DI: [Rotate] [Pat]tern ***********************************************)

PROCEDURE VPatRotate(Handle: UNSIGNEDWORD;
                     Angle : UNSIGNEDWORD);

(* [V]DI: [Save] Font [Cache] To Disk **************************************)

PROCEDURE VSaveCache(    Handle  : UNSIGNEDWORD;
                     VAR FileName: ARRAY OF CHAR): SIGNEDWORD;

(* [V]DI: [Load]/Merge Font [Cache] From Disk ******************************)

PROCEDURE VLoadCache(    Handle  : UNSIGNEDWORD;
                     VAR FileName: ARRAY OF CHAR;
                         Replace : BOOLEAN): SIGNEDWORD;

(* [V]DI: [Flush] Font [Cache] *********************************************)

PROCEDURE VFlushCache(Handle: UNSIGNEDWORD): SIGNEDWORD;

(* [V]DI: [Get] Bezier Representation Of An [Outline] Character ************)

PROCEDURE VGetOutline(    Handle  : UNSIGNEDWORD;
                          Char    : CHAR;
                      VAR XYArray : ARRAY OF XY;
                      VAR BezArray: ARRAY OF ANYBYTE;
                          MaxVerts: UNSIGNEDWORD;
                      VAR NumVerts: UNSIGNEDWORD);

(* [V]DI [S]et [T]ext Attributes: Set [Scratch] Buffer Allocation Mode *****)

PROCEDURE VSTScratch(Handle: UNSIGNEDWORD; Mode: UNSIGNEDWORD);

(* [V]DI [S]et [T]ext Attributes: Set FSM [Error] Mode *********************)

PROCEDURE VSTError(    Handle  : UNSIGNEDWORD;
                       Mode    : BOOLEAN;
                   VAR ErrorVar: SIGNEDWORD);

(* [V]DI [S]et [T]ext Attributes: Set [Char]acter [Map]ping Mode ***********)

PROCEDURE VSTCharMap(Handle: UNSIGNEDWORD; Mode: BOOLEAN);

(* [V]DI: [Q]uery [Scr]ee[n] [Info]rmation *********************************)

PROCEDURE VQScrnInfo(    Handle : UNSIGNEDWORD;
                     VAR WorkOut: ARRAY OF UNSIGNEDWORD);

END VControl.
